import config from '../config/config';
import request from '../utils/request';

let service = {};


service.phonenumber = (param, cb) => {
  param = param || {};
  let requestUrl = config.api.phoneNumber;
  request({
    url: requestUrl,
    // showLoading: true,
    data: param,
    method: 'POST',
    success: res => {
      cb(res);
    },
    fail: res => {
      // cb(res);
    }
  });
}
//获取每日任务中邀请好友查看商品和下单状态
service.getTaskStatus = (param, cb) => {
  param = param || {};
  let requestUrl = config.api.gettaskstatus;
  request({
    url: requestUrl,
    // showLoading: true,
    data: param,
    method: 'GET',
    success: res => {
      cb(res);
    },
    fail: res => {
      // cb(res);
    }
  });
}
//领取每日任务贝壳
service.addConch = (param, cb) => {
  param = param || {};
  let requestUrl = config.api.addconch;
  request({
    url: requestUrl,
    // showLoading: true,
    data: param,
    method: 'PUT',
    success: res => {
      cb(res);
    },
    fail: res => {
      // cb(res);
    }
  });
}
module.exports = service;
